<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head >
    <meta charset="UTF-8">
    <title th:text="${sectionName}"></title>
    <link rel="stylesheet" th:href="@{/css/bootstrap.min.css}">
    <link rel="stylesheet" th:href="@{/css/bootstrap-theme.min.css}">
    <link rel="stylesheet" th:href="@{/css/index.css}">
    <script th:src="@{/js/jquery-3.3.1.js}"></script>
    <script th:src="@{/js/bootstrap.min.js}"></script>
</head>
<body>
<div th:insert="~{navigation :: header}"></div>
<div class="container-fluid main profile">
    <div class="row">
        <div class="col-lg-9 col-md-12 col-sm-12 col-xs-12" style="">

            <h2><span th:text="${sectionName}"></span></h2>
            <hr>
            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12" th:if="${ section =='questions' }">
                <div class="media" th:each="pageDto :${pageList.data}">
                    <div class="media-left">
                        <a href="#">
                            <img class="img-circle"
                                 th:src="${pageDto.user.avatarUrl}">
                        </a>
                    </div>
                    <div class="media-body">
                        <h4 class="media-heading description" th:text="${pageDto.title}"></h4>
                        <span><a th:href="@{'/question/'+ ${pageDto.id}}"><span>点击进入</span></a></span> <span th:text="${pageDto.description}"></span><br>
                        <span class="text" th:text="${pageDto.commentCount}"></span>个回复 |
                        <span class="text" th:text="${pageDto.viewCount}"></span> 次浏览  |
                        <span class="text" th:text="${pageDto.likeCount}"></span> 次喜欢  |
                        <span class="text" th:text="${#dates.format(pageDto.gmtCreate,'yyyy年MM月dd日')}"></span>  |
                        <a th:href="@{'/publish/edit/'+ ${pageDto.id}}" class="community_menue" th:if="${session.user != null && pageDto.creator == session.user.id}">
                            <span class="glyphicon glyphicon-pencil edit_question" aria-hidden="true">编辑</span>
                            <hr class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                        </a>
                    </div>
                </div>
                <nav aria-label="Page navigation">
                    <ul class="pagination">
                        <li th:if="${pageList.showFirstPage}">
                            <a th:href="@{'/profile/'+${section}(currentPage=1)}" aria-label="Previous">
                                <span aria-hidden="true">首页</span>
                            </a>
                        </li>
                        <li th:if="${pageList.showPreviousPage}">
                            <a th:href="@{'/profile/'+${section}(currentPage=${pageList.currentPage - 1})}" aria-label="Previous">
                                <span aria-hidden="true">上一页</span>
                            </a>
                        </li>
                        <li th:each="page :${pageList.pages}" th:class="${pageList.currentPage == page} ? 'active': ''">
                            <a th:href="@{'/profile/'+${section}(currentPage=${page})}" th:text="${page}">

                            </a></li>
                        <li th:if="${pageList.showNextPage}">
                            <a th:href="@{'/profile/'+${section}(currentPage=${pageList.currentPage + 1})}" aria-label="Next">
                                <span aria-hidden="true">下一页</span>
                            </a>
                        </li>
                        <li th:if="${pageList.showLastPage}">
                            <a th:href="@{'/profile/'+${section}(currentPage=${pageList.pageTotalCount})}" aria-label="Next">
                                <span aria-hidden="true">尾页</span>
                            </a>
                        </li>
                    </ul>
                </nav>
                <span>总记录数&nbsp;</span><span style="color: #074a54" th:text="${pageList.dataTotalCount}"></span>
                <apan>总页码&nbsp;</apan><span style="color: #074a54" th:text="${pageList.pageTotalCount}"></span>
            </div>
            <!--我的博客-->
            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12" th:if="${ section =='blog' }">
                <div class="media" th:each="pageDto :${pageList.data}">
                    <div class="media-left">
                        <a href="#">
                            <img class="img-circle"
                                 th:src="${pageDto.user.avatarUrl}">
                        </a>
                    </div>
                    <div class="media-body">
                        <h4 class="media-heading description" th:text="${pageDto.title}"></h4>
                        <span><a th:href="@{'/blog/'+ ${pageDto.id}}"><span>点击进入</span></a></span> <span th:text="${pageDto.content}"></span><br>
                        <span class="text" th:text="${pageDto.commentCount}"></span>个回复 |
                        <span class="text" th:text="${pageDto.viewCount}"></span> 次浏览  |
                        <span class="text" th:text="${pageDto.likeCount}"></span> 次喜欢  |
                        <span class="text" th:text="${#dates.format(pageDto.gmtCreate,'yyyy年MM月dd日')}"></span>  |
                        <a th:href="@{'/publishBlog/edit/'+ ${pageDto.id}}" class="community_menue" th:if="${session.user != null && pageDto.writer == session.user.id}">
                            <span class="glyphicon glyphicon-pencil edit_question" aria-hidden="true">编辑</span>
                            <hr class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                        </a>
                    </div>
                </div>
                <nav aria-label="Page navigation">
                    <ul class="pagination">
                        <li th:if="${pageList.showFirstPage}">
                            <a th:href="@{'/profile/'+${section}(currentPage=1)}" aria-label="Previous">
                                <span aria-hidden="true">首页</span>
                            </a>
                        </li>
                        <li th:if="${pageList.showPreviousPage}">
                            <a th:href="@{'/profile/'+${section}(currentPage=${pageList.currentPage - 1})}" aria-label="Previous">
                                <span aria-hidden="true">上一页</span>
                            </a>
                        </li>
                        <li th:each="page :${pageList.pages}" th:class="${pageList.currentPage == page} ? 'active': ''">
                            <a th:href="@{'/profile/'+${section}(currentPage=${page})}" th:text="${page}">

                            </a></li>
                        <li th:if="${pageList.showNextPage}">
                            <a th:href="@{'/profile/'+${section}(currentPage=${pageList.currentPage + 1})}" aria-label="Next">
                                <span aria-hidden="true">下一页</span>
                            </a>
                        </li>
                        <li th:if="${pageList.showLastPage}">
                            <a th:href="@{'/profile/'+${section}(currentPage=${pageList.pageTotalCount})}" aria-label="Next">
                                <span aria-hidden="true">尾页</span>
                            </a>
                        </li>
                    </ul>
                </nav>
                <span>总记录数&nbsp;</span><span style="color: #074a54" th:text="${pageList.dataTotalCount}"></span>
                <apan>总页码&nbsp;</apan><span style="color: #074a54" th:text="${pageList.pageTotalCount}"></span>
            </div>
            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12" th:if="${ section =='reply' }">
                <div class="media" th:each="notificationDto :${pageList.data}">
                    <div class="media-body">
                        <p class="media-heading ">
                                <span th:text="${notificationDto.notifiName + '  ' } " class="notifi_notifiName"></span>
                                <span th:text="${notificationDto.typeName + '  '} "></span>
                                <a th:href="@{'/notification/'+ ${notificationDto.id}}" class="outerTitle">
                                    <span th:text="${notificationDto.outerTitle}" class="notifi_outerTitle"></span>
                                </a>
                            <span  class="label label-danger" th:if="${notificationDto.status == 0}">未读</span>
                        </p>

                    </div>
                </div>
                <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                    <nav aria-label="Page navigation">
                        <ul class="pagination">
                            <li th:if="${pageList.showFirstPage}">
                                <a th:href="@{'/profile/'+${section}(currentPage=1)}" aria-label="Previous">
                                    <span aria-hidden="true">首页</span>
                                </a>
                            </li>
                            <li th:if="${pageList.showPreviousPage}">
                                <a th:href="@{'/profile/'+${section}(currentPage=${pageList.currentPage - 1})}" aria-label="Previous">
                                    <span aria-hidden="true">上一页</span>
                                </a>
                            </li>
                            <li th:each="page :${pageList.pages}" th:class="${pageList.currentPage == page} ? 'active': ''">
                                <a th:href="@{'/profile/'+${section}(currentPage=${page})}" th:text="${page}">

                                </a></li>
                            <li th:if="${pageList.showNextPage}">
                                <a th:href="@{'/profile/'+${section}(currentPage=${pageList.currentPage + 1})}" aria-label="Next">
                                    <span aria-hidden="true">下一页</span>
                                </a>
                            </li>
                            <li th:if="${pageList.showLastPage}">
                                <a th:href="@{'/profile/'+${section}(currentPage=${pageList.pageTotalCount})}" aria-label="Next">
                                    <span aria-hidden="true">尾页</span>
                                </a>
                            </li>
                        </ul>
                    </nav>
                    <span>总记录数&nbsp;</span><span style="color: #074a54" th:text="${pageList.dataTotalCount}"></span>
                    <apan>总页码&nbsp;</apan><span style="color: #074a54" th:text="${pageList.pageTotalCount}"></span>
                </div>
            </div>
        </div>
        <div class="col-lg-3 col-md-12 col-sm-12 col-xs-12">
            <div class="list-group profile" >
                <a th:href="@{/profile/questions}"  th:class="${ section =='questions' } ? 'active list-group-item': 'list-group-item'">
                    我的问题
                </a>
                <a th:href="@{/profile/blog}"  th:class="${ section =='blog' } ? 'active list-group-item': 'list-group-item'">
                    我的博客
                </a>
                <a th:href="@{/profile/reply}"  th:class="${ section =='reply' } ? 'active list-group-item': 'list-group-item'">
                    <span class="badge" th:text="${session.unreadCount}"></span>
                    最新回复
                </a>

            </div>
            <div th:insert="~{side :: side}"></div>
        </div>
    </div>
</div>
<div th:insert="~{footer :: foot}"></div>
</body>
</html>